package com.wisemoresystem.seal.util.file;

import java.io.IOException;
import java.io.OutputStream;

import org.ne.framework.data.util.ChkTools;

public class FileTools {

	public static String getSuffix(String filename) {
		if (ChkTools.isNull(filename)) {
			return "";
		}
		if (!filename.contains(".")) {
			return "";
		}
		return filename.substring(filename.lastIndexOf(".") + 1);
	}

	public static void main(String[] args) {
		String s = "x.ds";
		System.err.println(FileTools.getSuffix(s));

	}

	public static void close(OutputStream out) {
		// TODO Auto-generated method stub
		if (out != null) {
			try {
				out.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
